<ng-container [formGroup]="form()">
  @if(isFibreChannelMode()) {
    <ix-fc-ports-controls [form]="form().controls.fcport"></ix-fc-ports-controls>
  } @else {
    <ix-select
      formControlName="portal"
      [label]="helptextSharingIscsi.portalLabel | translate"
      [tooltip]="helptextSharingIscsi.portalTooltip | translate"
      [options]="portalOptions$"
      [required]="true"
    ></ix-select>
    @if (isNewPortal) {
      <ix-list
        formArrayName="listen"
        [empty]="form().controls.listen.controls.length === 0"
        [label]="helptextSharingIscsi.portal.ipLabel | translate"
        [tooltip]="helptextSharingIscsi.portal.ipTooltip | translate"
        [required]="true"
        [formArray]="form().get('listen')"
        (add)="addAddress()"
        >
        @for (network of form().controls.listen.controls; track network; let i = $index) {
          <ix-list-item
            [label]="helptextSharingIscsi.portal.ipLabel | translate"
            (delete)="removeAddress(i)"
            >
            <ix-select
              [formControlName]="i"
              [label]="helptextSharingIscsi.portal.ipLabel  | translate"
              [options]="addressOptions$"
              [required]="true"
            ></ix-select>
          </ix-list-item>
        }
      </ix-list>
    }
    <ix-chips
      formControlName="initiators"
      [label]="helptextSharingIscsi.initiatorsLabel | translate"
      [tooltip]="helptextSharingIscsi.initiatorsTooltip | translate"
    ></ix-chips>
  }
</ng-container>
